import { createRouter, createWebHashHistory } from 'vue-router'
import Login from '../components/login.vue'
import Home from '../views/Home.vue'
import Student from '../views/student.vue'
import Editstudent from '../views/editstudent.vue'
import Addstudent from '../views/Addstudent.vue'
import Welcome from '../views/welcome.vue'
import Teacher from '../views/teacher.vue'
import Dormitory from '../views/dormitory'
import Evaluation from '../views/evaluation'

const routes = [
  {
    path: '/',
    name: 'login',
    component: Login
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/home',
    component: Home,
    redirect: '/welcome',
    children: [
      { path: '/welcome', component: Welcome },
      { path: '/student', component: Student },
      { path: '/teacher', component: Teacher },
      { path: '/dormitory', component: Dormitory },
      { path: '/evaluation', component: Evaluation }
    ]
  },
  {
    path: '/addstudent',
    component: Addstudent
  },
  {
    path: '/editstudent',
    component: Editstudent
  }

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
